using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TimeData
{
    /// <summary>
    /// 时间缩放大小
    /// </summary>
    public BaseData LocalTimeScale { get; set; } = new BaseData();

    public static readonly TimeData One = new TimeData(1);

    public TimeData()
    {

    }
    
    public TimeData(float time)
    {
        LocalTimeScale=new BaseData(time);
    }

    public void Plus(TimeData timeData)
    {
        LocalTimeScale += timeData.LocalTimeScale;
    }
    
    public void Minus(TimeData timeData)
    {
        LocalTimeScale -= timeData.LocalTimeScale;
    }

    /// <summary>
    /// 隐式装换成float
    /// <para>直接返回LocalTimeScale.Final的值</para>
    /// </summary>
    public static implicit operator float(TimeData timeData)
    {
        return timeData.LocalTimeScale.Final;
    }
}
